﻿using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.Web.Mvc;

namespace NetSurveillance.WebApp.Models
{
    public class MultiSearchModel
    {
        public long? Id { get; set; }

        [Display(Name = "监控协议")]
        public string Protocol { get; set; }

        [Required]
        [StringLength(20)]
        [Display(Name = "主题")]
        public string Subject { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [DataType(DataType.DateTime)]
        [Display(Name = "开 始")]
        public DateTime? StartDate { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [DataType(DataType.DateTime)]
        [Display(Name = "结 束")]
        public DateTime? EndDate { get; set; }

        [StringLength(20)]
        [Display(Name = "用 户")]
        public string Account { get; set; }

        [StringLength(200)]
        [Display(Name = "密 码")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [StringLength(32)]
        [RegularExpression(@"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$", ErrorMessage = "Ip is not validate")]
        [Display(Name = "主 机IP")]
        public string IP { get; set; }

        [StringLength(32)]
        [Display(Name = "主机Mac")]
        public string Mac { get; set; }

        [StringLength(32)]
        [RegularExpression(@"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$", ErrorMessage = "Remote Ip is not validate")]
        [Display(Name = "远 程IP")]
        public string RemoteIP { get; set; }

        [StringLength(32)]
        [Display(Name = "远程Mac")]
        public string RemoteMac { get; set; }

        [EmailAddress]
        [Display(Name = "发送者")]
        [DataType(DataType.EmailAddress)]
        public string EmailFrom { get; set; }

        [EmailAddress]
        [Display(Name = "接收者")]
        [DataType(DataType.EmailAddress)]
        public string EmailTo { get; set; }

        [StringLength(64)]
        [Display(Name = "抄送者")]
        public string EmailCC { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [DataType(DataType.DateTime)]
        [Display(Name = "邮件日期")]
        public DateTime? EmailDate { get; set; }

        [StringLength(64)]
        [Display(Name = "操作系统")]
        public string SystemInfo { get; set; }

        [StringLength(64)]
        [Display(Name = "客户端软件")]
        public string ClientVer { get; set; }

        [StringLength(32)]
        [Display(Name = "文件类型")]
        public string FileType { get; set; }

        [StringLength(200)]
        [Display(Name = "URL")]
        public string Url { get; set; }

        public string SearchFrom { get; set; }
    }
}